//
// Project: Disagreement in science: Missing women



clear all
version 15.1  



//
// set locals, seed, etc
local treatment "plain"


use "${data}/output/contest_experiment.dta", clear



//
// analysis
tempname memhold
postfile `memhold' enforce female takeup lower upper using "${data}/temporary/figure_choice_experiment.dta", replace
forvalues i=0/1 {  // enforce index
	forvalues j=0/1 {  // female index
		mean intro1playerlook if intro1playertreatment=="`treatment'" & enforce==`i' & female==`j', level(90)
		matrix m = r(table)
		local mean = m[1,1]
		local lower = m[5,1]
		local upper = m[6,1]
		post `memhold' (`i') (`j') (`mean') (`lower') (`upper')
	}
}
postclose `memhold'
use "${data}/temporary/figure_choice_experiment.dta", clear
generate bin = (1-enforce) + 1
replace bin = bin+0.4 if female==1
twoway (bar takeup bin if female==0, barwidth(0.35) color(gs3%80)) (bar takeup bin if female==1, barwidth(0.35) lcolor(gs6) fcolor(gs15%80)) (rcap lower upper bin, color(black)), yscale(r(0,0.5)) plotregion(style(none)) scheme(s1color) xtitle("") ytitle("Share of subjects who opt in") xlabel(0.5 " " 1.2 "Contest treatment" 2.2 "Deduct-a-$1 treatment" 2.9 " ", noticks) ylabel(0 0.1 "0.1" .20 `"0.2"' 0.3 "0.3" .40 `"0.4"' 0.5 "0.5", grid angle(horizontal) labsize(medsmall)) legend(row(1) size(medsmall) order(1 "Male" 2 "Female") region(style(none)))
graph export "${output}/choice_experiment.png", replace

